public class Solution2027 {
    public int minimumMoves(String s) {
        char[] chars=s.toCharArray();
        int ans=0;
        for (int i=0;i<s.length();i++){
            if (chars[i]=='X'){
                if (i+1<s.length()){
                    chars[i+1]='O';
                }
                if (i+2<s.length()){
                    chars[i+2]='O';
                }
                ans++;
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution2027().minimumMoves("XXX"));
    }
}
